// 此处用于存放与加入购物车有关的所有接口请求
import request from '@/utils/request'

// 将数据加入购物车
export const addCar = (goodsId, goodsNum, goodsSkuId) => {
  return request.post('/cart/add', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}

// 获取购物车列表
export const getCar = () => {
  return request.get('/cart/list')
}

// 更新购物车
export const updateCar = (goodsId, goodsNum, goodsSkuId) => {
  return request.post('/cart/update', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}
// 删除购物车
export const delCar = (cartIds) => {
  return request.post('/cart/clear', {
    cartIds
  })
}
